import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import './utils/element-ui';
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

Vue.config.productionTip = false
import VueRouter from 'vue-router'

// 获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
// 修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => {
    // 忽略 NavigationDuplicated 和 Navigation cancelled 错误
    if (err.name !== 'NavigationDuplicated' &&
      !err.message.includes('Navigation cancelled')) {
      throw err
    }
  })
}

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
